import request from '@/utils/request'

// 查询请假管理列表
export function listLeaveRequest(query) {
  return request({
    url: '/residing/leaveRequest/list',
    method: 'get',
    params: query
  })
}

// 查询请假管理详细
export function getLeaveRequest(id) {
  return request({
    url: '/residing/leaveRequest/' + id,
    method: 'get'
  })
}

// 新增请假管理
export function addLeaveRequest(data) {
  return request({
    url: '/residing/leaveRequest',
    method: 'post',
    data: data
  })
}

// 修改请假管理
export function updateLeaveRequest(data) {
  return request({
    url: '/residing/leaveRequest',
    method: 'put',
    data: data
  })
}

// 删除请假管理
export function delLeaveRequest(id) {
  return request({
    url: '/residing/leaveRequest/' + id,
    method: 'delete'
  })
}

// 获取老人详细信息
export function getElderInfo(id) {
  return request({
    url: '/residing/leaveRequest/elder/' + id,
    method: 'get'
  })
}

// 获取老人列表
export function getElderNameList() {
  return request({
    url: '/residing/leaveRequest/elder/list',
    method: 'get'
  })
}

// 请假审批
export function approvalComplete(data) {
  return request({
    url: '/residing/leaveRequest/approval',
    method: 'post',
    data: data
  })
}

//添加审批记录
export function addApprovalRecord(data){
  return request({
    url: '/system/record',
    method: 'post',
    data: data
  })
}




